<template>
  <div>
    <el-col :span="24">

      <el-row>
        <div align="center"><h1>解密页面</h1></div>
      </el-row>

      <el-row>
        <el-col :span="2"><div class="grid-content">&nbsp;</div></el-col>
        <el-col :span="4"><div class="grid-content">

          <h2>1.当前登录用户</h2>

          <el-tag style="font-size: 20px"><b>{{ GetUser }}</b></el-tag>


          <h2>2.解密</h2></div>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="2"><div class="grid-content">&nbsp;</div></el-col>
        <el-col :span="20"><div class="grid-content">

          <!-- <h4>选择解密版本（账号修改了密钥，就会产生一个版本）:</h4>
          <el-select v-model="value" placeholder="请选择">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select> -->

          <h4>密文:</h4>
          <el-input v-model="image"  type="textarea"  rows="2" placeholder="请输入内容" />
          <br><br>
          <el-button type="primary" style="width:20%" icon="el-icon-top" @click="sumbit">提交解密</el-button>
          <br><br>
          </div>
          <div v-show="play" v-highlight>
            <pre><code class="javascript" v-html="message2" /></pre>
          </div>

        </el-col>
      </el-row>



    </el-col>
  </div>

</template>

<script>
import { deciphering } from '@/api/query'

export default {
  data() {
    return {
        // options: [{
        //   value: '111',
        //   label: '111'
        // },{
        //   value: '222',
        //   label: '222'
        // }],
        // value: '',
      image: '',
      message2: '',
      play: false,
      msg:'加载中',
    }
  },
  created() {
    // this.getversion()
  },
  computed:{
        GetUser(){
            console.log(this.$store.state.user.token)
            return this.$store.state.user.token
        }
    },
  methods: {
    sumbit() {
      this.play = true
      deciphering({ 'name': this.GetUser, 'text': this.image}).then(response => {
        console.log(response.data)
        this.message2 = response.data
        this.msg = response.data.name
        // this.value= response.data.podname
      })
    },
    // getversion() {
    //   getversion({ 'name': this.GetUser}).then(response => {
    //     console.log(response.data)
    //     this.options = response.data
    //     // this.value= response.data.podname
    //   })
    // },
  }
}
</script>

<style scoped>
.el-col {
  min-height: 1px
}
</style>
